package com.hkd.friend.controller.user;

import com.hkd.common.core.constants.HttpConstants;
import com.hkd.common.core.domain.R;
import com.hkd.common.core.domain.TableDataInfo;
import com.hkd.friend.domain.exam.dto.ExamDTO;
import com.hkd.friend.domain.exam.dto.ExamQueryDTO;
import com.hkd.friend.service.user.IUserExamService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@Tag(name = "C端用户竞赛管理")
@RequestMapping("/user/exam")
public class UserExamController {
    @Autowired
    private IUserExamService userExamService;

    @PostMapping("/enter")
    public R enter(@RequestHeader(HttpConstants.AUTHENTICATION) String token, @RequestBody ExamDTO examDTO){
        return userExamService.enter(token,examDTO);
    }

    @GetMapping("/list")
    public TableDataInfo list(ExamQueryDTO examQueryDto){
        return userExamService.list(examQueryDto);
    }


}
